﻿using PMSystem.ApplicationLogics;
using PMSystem.DataAccess;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PMSytem.Windows.App.Util
{
   public class AuditManager
    {
       static string msg = "{0} user has {1}";
       public static void AddAuditRecord(AuditEntity entity, string message)
       {
           var _newaudit = new Audit()
           {
               AuditType = entity.ToString(),
               AuditSummary = string.Format(msg, LoginUser.CurrentUser.UserName, message)
           };
           new AuditService().CreateAuditEntry(_newaudit);
       }
    }

   public enum AuditEntity
   {
       CreateRecord,
       UpdateRecord,
       ViewRecord,
       DeleteRecord,
       DeleteRecordImage,
       CreateUser,
       EditUser,
       DeleteUser
   }
}
